export default {
    deepClone: function (source: any) {
        if (!source && typeof source !== 'object') {
            throw new Error('error arguments')
        }
        const targetObj: any = source.constructor === Array ? [] : {}
        Object.keys(source).forEach(keys => {
            if (source[keys] && typeof source[keys] === 'object') {
                targetObj[keys] = this.deepClone(source[keys])
            } else {
                targetObj[keys] = source[keys]
            }
        })
        return targetObj
    }
}
